<style lang="scss">
	.webview {
		display: flex;
		width: 750rpx;
		height: 100%;
		/* #ifdef H5 || MP */
		//margin-top: 90rpx;
		/* #endif */
	}
</style>
<template>
	<view>
		<web-view :src="url" 
		:webview-styles="webviewStyles" 
		ref="webview" class="webview"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: null,
				title: '',
				webviewStyles: {
					sprogress: {
						color: '#FF3333' //进度条样式。仅加载网络 HTML 时生效，设置为 false 时禁用进度条。
					}
				},
				// #ifdef H5
				WebviewHeight: uni.getSystemInfoSync().windowHeight - Number(45), //前去下载APP的占用高度
				// #endif
				// #ifdef MP || APP-PLUS || APP-NVUE
				WebviewHeight: uni.getSystemInfoSync().windowHeight
				// #endif
			};
		},
		onLoad({url,title}) {
			console.log(url,title)
			this.url = url
			this.title = title
			if(title){
				uni.setNavigationBarTitle({title})
			}
		},
		//NVUE下navigateBack，backbutton无效，直接关闭页面。而不是浏览器后退
		onBackPress(e) {
			console.log(e)
			if (e.from === 'navigateBack') {
				//关闭
				return false
			} else if (e.from === 'backbutton') {
				//后退
				return false
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">

</style>
